package com.example.app_struct.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding

// TODO: 实现请求状态传递 （错误页展示，loading展示等）
abstract class BaseActivity<VM: BaseViewModel, VB: ViewBinding>: AppCompatActivity() {
    lateinit var binding: VB

    abstract  fun initBinding(): VB

    abstract fun initView()

    abstract fun initData()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = initBinding()

        setContentView(binding.root)

        initView()

        initData()
    }
}
